import express from 'express'
import {check, body, param} from 'express-validator'
const router = express.Router()
import {getCarousel, saveCarousel,updateCarousel, delCarousel} from '../services/carouselServ'
router.get('/getCarousel', getCarousel)
    .post('/saveCarousel'
            ,body('title').not().isEmpty()
            , body('imgSrc').not().isEmpty()
            , body('path').not().isEmpty()
            ,saveCarousel)
    .put('/updateCarousel/:id'
            ,param('id').not().isEmpty()
            ,body('title').not().isEmpty()
            , body('imgSrc').not().isEmpty()
            , body('path').not().isEmpty()
            , updateCarousel)
    .delete('/delCarousel/:id', delCarousel)
export default router